package offer;

import java.util.ArrayList;
import java.util.List;

public class offerII_0058 {
    class MyCalendar {
        List<int[]> list;
        int len;
        public MyCalendar() {
            list=new ArrayList<>();
            len=0;
        }

        public boolean book(int start, int end) {
            for(int i=0;i<len;++i){
                if(!(end<=list.get(i)[0]||start>=list.get(i)[1])) return false;
            }
            int[] tmp={start,end};
            list.add(tmp);
            len++;
            return true;
        }
    }
}
